import { Request } from './client';
import { HTMLParser } from './parsers';

void async function () {
  const request = new Request({
    method: 'GET',
    host: '127.0.0.1',
    port: 8088,
    path: '/',
    headers: {
      ['X-Header']: 'custom header value',
    },
    body: {
      name: 'custom body value',
    },
  });

  const response = await request.send();

  const parser = new HTMLParser();
  const dom = parser.parse(response.body);

  console.log(JSON.stringify(dom, null, 2));
}();